- content_for :title do
  = t('.title')

- content_for :section_title do
  = t('.title')

.row
  .col-md-6
    .card.system_info
      .card-header
        h3.card-title = t('.server_info')
      .card-body
        dl.system-info
          dt = t('.zealot_version')
          dd[
            data-controller="admin-new-release"
            data-admin-new-release-version-value="#{zealot_version}"
            data-admin-new-release-title-value="#{Rails.env.development? ? t('.dev_new_version') : t('.new_version')}"
          ]
            pre
              #current-version = zealot_version(suffix: true)
              #new-version data-admin-new-release-target="newVersion"
          - if @server[:zealot_vcs_ref]
            dt = t('.vcs_ref')
            dd
              pre = vcs_ref_link(@server[:zealot_vcs_ref])
          - if @server[:build_date]
            dt = t('.build_date')
            dd
              pre = @server[:build_date]
          dt = t('.os_info')
          dd
            pre = @server[:os_info]
          dt = t('.ruby_version')
          dd
            pre = @server[:ruby_version]
          dt = t('.cpu_info')
          dd
            pre
              - if @server[:cpu]
                = t('.cpu_core', count: @server[:cpu])
              - else
                = t('.fail_detect_cpu')
          dt = t('.memory_info')
          dd
            pre
              - if memory = @server[:memory]
                = "#{number_to_human_size(memory[:used])} / #{number_to_human_size(memory[:total])}"
                .progress.
                  .progress-bar-striped class="#{memory[:color]}" role="progressbar" aria-valuenow="#{memory[:percent]}" aria-valuemin="0" aria-valuemax="100" style="width: #{memory[:percent]}%"
                    span.sr-only = "#{memory[:percent]}%"
              - else
                = t('.fail_detect_memory')
          dt = t('.disk_info')
          dd
            pre
              - if diskspace = @server[:diskspace]
                = "#{number_to_human_size(diskspace[:used])} / #{number_to_human_size(diskspace[:total])}"
                .progress
                  .progress-bar-striped class="#{diskspace[:color]}" role="progressbar" aria-valuenow="#{diskspace[:percent]}" aria-valuemin="0" aria-valuemax="100" style="width: #{diskspace[:percent]}%"
                    span.sr-only = "#{diskspace[:percent]}%"
              - else
                = t('.fail_detect_disk')
          dt = t('.lauched_time')
          dd
            pre
              = distance_of_time_in_words_to_now(@server[:booted_at])
              |  (
              = @server[:booted_at]
              | )

  .col-md-6
    .card.card-outline class="#{@file_permissions[:health] ? 'card-success' : 'card-danger'}"
      .card-header
        h3.card-title = t('.file_permissions')
        .card-tools
          button.btn.btn-tool data-card-widget="collapse"
            i.fas.fa-minus
      .card-body.p-0
        p.pl-4.pt-3 = t('.messages.file_permissions_tip', icon: '<i class="fas fa-exclamation-triangle text-red">')
        table.table
          - @file_permissions[:permissions].each do |permission|
            tr
              td = permission[:path]
              td style="width: 20px"
                - if permission[:health]
                  i.fas.fa-check.text-green
                - else
                  i.fas.fa-exclamation-triangle.text-red
    .card
      .card-header
        h3.card-title = t('.services')
        .card-tools
          button.btn.btn-tool data-card-widget="collapse"
            i.fas.fa-minus
      .card-body.p-0
        table.table
          - @services.each do |name, health|
            tr
              td = "#{name} #{health}"
              td style="width: 20px"
                - if health
                  i.fas.fa-check.text-green
                - else
                  i.fas.fa-exclamation-triangle.text-red

    .card
      .card-header
        h3.card-title = t('.volume_mounted')
        .card-tools
          button.btn.btn-tool data-card-widget="collapse"
            i.fas.fa-minus
      .card-body
        - unless @disks.blank?
          dl.system-info
            - @disks.each do |disk|
              dt = disk[:mount_path]
              dd
                pre
                  = "#{number_to_human_size(disk[:bytes_used])} / #{number_to_human_size(disk[:bytes_total])}"
                  .progress data-mount-options="#{disk[:mount_options]}"
                    .progress-bar-striped class="#{disk[:color]}" role="progressbar" aria-valuenow="#{disk[:percent]}" aria-valuemin="0" aria-valuemax="100" style="width: #{disk[:percent]}%"
                      span.sr-only = "#{disk[:percent]}%"
        - else
          = t('.fail_detect_disk')

    .card.collapsed-card
      .card-header
        h3.card-title = t('.system_environment')
        .card-tools
          button.btn.btn-tool data-card-widget="collapse"
            i.fas.fa-plus
      .card-body
        dl.system-info
          - @env.each do |key, value|
            dt = key
            dd
              pre
                = secure_value(key, value)

    .card.collapsed-card
      .card-header
        h3.card-title = t('.ruby_gems')
        .card-tools
          button.btn.btn-tool data-card-widget="collapse"
            i.fas.fa-plus
      .card-body.p-0
        table.table
          - @gems.each do |name, version|
            tr
              td = name
              td = version
